import { LibAppView } from "../../../lib";

export const LoginReducer = LibAppView.createReducer({
    initState: {
        adminData: {
            id: "",
            name: "",
            password: "",
            nickName: "",
            userName: "",
            status: "",
            createAt: "",
            updateAt: "",
            salt: "",
        }
    },
    name: "login",
    handler: (state, opt) => {
        const adminData = JSON.parse(sessionStorage.getItem("AdminData")?? "{}");
        return {
            ...state,
            adminData
        }
    }
});